package com.banyuan.HomeWork.interfacedemo;

import static java.lang.StrictMath.PI;
import static java.lang.StrictMath.pow;

public class Circle extends Shape {
    private int radius;

    public Circle(String color, int radius) {
        super(color);
        this.radius = radius;
    }

    @Override
    public double getArea() {
        return PI * pow(radius, 2);
    }

    @Override
    public double getPer() {
        return 2 * PI * radius;
    }

    @Override
    public void show() {
        System.out.println("该圆的面积是：" + this.getArea());
        System.out.println("该圆的周长是：" + this.getPer());
        System.out.println("该圆的颜色是：" + this.getColor());
    }
}
